package com.song.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author 刘庆东
 * @ClassName ContantsProperties
 * @description:  解析配置文件中自定义的配置
 * @datetime 2025年 1月 08日 15:58
 * @version: 1.0
 */
@Component
public class ContantsProperties implements InitializingBean {


    @Value("${aliyun.oss.endpoint}")
    private String endpoint;  //区域

    @Value("${aliyun.oss.accessKeyId}")
    private String accesskeyid; //oss的key

    @Value("${aliyun.oss.secret}")
    private String accesskeyssecret; // oss的密钥

    @Value("${aliyun.oss.bucket}")
    private String bucketName; // oss桶

    public static  String ENDPOINT;
    public static  String ACCESS_KEY_ID;
    public static  String ACCESSKEY_SSECRET;
    public static  String BUCKET_NAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT=endpoint;
        ACCESS_KEY_ID=accesskeyid;
        ACCESSKEY_SSECRET=accesskeyssecret;
        BUCKET_NAME=bucketName;


    }
}
